#ifndef _BT_EVENTS_H_
#define _BT_EVENTS_H_

#include <SDL/SDL.h>
#include <map>
#include "xmlobject.h"

namespace bt
{
	class EventHandler
	{
	public:
		virtual void handleEvent(SDL_Event* event) = 0;
	};
	
	// Extensible input state device
	class InputListener : public XMLObject
	{
	public:
		InputListener();
		
		~InputListener();
		
		// Accessors
		bool isPressed(const char* actionName);
		
		// Mutators
		void addAction(const char* actionName, Uint8 action);
		
		// Actions
		void update();
		
		// Inherited from XMLObject
		virtual bool loadFromXML(xmlDoc* doc, xmlNode* node);
		
		virtual void writeToXML(xmlDoc* doc, xmlNode* node);
		
	private:
		Uint8* keyState;
		
		std::map<const char*, Uint8> actions;
	};
}

#endif /* _BT_EVENTS_H_ */
